import { del, get, post } from '../../../config/axios'
import { IResponse } from '../../../config/axios/type'
import { findData, addUserType } from '../../store/userStore/types'

enum USER_URL {
  USERINFO = '/user/getUserInfo',
  GETUSERLIST = '/user/listAll',
  DELETEUSER = '/user/deleteUserById',
  ADDUSER = '/user/addUser'
}

export default {
  getInfo: async () => get<IResponse>({ url: USER_URL.USERINFO }),
  getUserList: async (data: findData) => post<IResponse>({ url: USER_URL.GETUSERLIST, data }),
  deleteUserById: async (id: any) => del<IResponse>({ url: USER_URL.DELETEUSER + '/' + id }),
  addUser: async (data: addUserType) => post<IResponse>({ url: USER_URL.ADDUSER, data })
}
